package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallUserHierarchy;
import com.appkubes.mall.core.po.MallUserHierarchyExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallUserHierarchyMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserHierarchySqlProvider.class, method="countByExample")
    long countByExample(MallUserHierarchyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallUserHierarchySqlProvider.class, method="deleteByExample")
    int deleteByExample(MallUserHierarchyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_user_hierarchy",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String userKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_user_hierarchy (user_key, app_key, ",
        "parent_user_key, parent_user_key2, ",
        "parent_user_key3, parent_user_key4, ",
        "parent_user_key5, promoter_key, ",
        "version)",
        "values (#{userKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{parentUserKey,jdbcType=VARCHAR}, #{parentUserKey2,jdbcType=VARCHAR}, ",
        "#{parentUserKey3,jdbcType=VARCHAR}, #{parentUserKey4,jdbcType=VARCHAR}, ",
        "#{parentUserKey5,jdbcType=VARCHAR}, #{promoterKey,jdbcType=VARCHAR}, ",
        "#{version,jdbcType=INTEGER})"
    })
    int insert(MallUserHierarchy record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallUserHierarchySqlProvider.class, method="insertSelective")
    int insertSelective(MallUserHierarchy record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserHierarchySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key", property="parentUserKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key2", property="parentUserKey2", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key3", property="parentUserKey3", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key4", property="parentUserKey4", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key5", property="parentUserKey5", jdbcType=JdbcType.VARCHAR),
        @Result(column="promoter_key", property="promoterKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserHierarchy> selectByExampleWithRowbounds(MallUserHierarchyExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserHierarchySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key", property="parentUserKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key2", property="parentUserKey2", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key3", property="parentUserKey3", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key4", property="parentUserKey4", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key5", property="parentUserKey5", jdbcType=JdbcType.VARCHAR),
        @Result(column="promoter_key", property="promoterKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserHierarchy> selectByExample(MallUserHierarchyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "user_key, app_key, parent_user_key, parent_user_key2, parent_user_key3, parent_user_key4, ",
        "parent_user_key5, promoter_key, version",
        "from mall_user_hierarchy",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key", property="parentUserKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key2", property="parentUserKey2", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key3", property="parentUserKey3", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key4", property="parentUserKey4", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_user_key5", property="parentUserKey5", jdbcType=JdbcType.VARCHAR),
        @Result(column="promoter_key", property="promoterKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallUserHierarchy selectByPrimaryKey(String userKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserHierarchySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallUserHierarchy record, @Param("example") MallUserHierarchyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserHierarchySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallUserHierarchy record, @Param("example") MallUserHierarchyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserHierarchySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallUserHierarchy record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_hierarchy
     *
     * @mbg.generated
     */
    @Update({
        "update mall_user_hierarchy",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "parent_user_key = #{parentUserKey,jdbcType=VARCHAR},",
          "parent_user_key2 = #{parentUserKey2,jdbcType=VARCHAR},",
          "parent_user_key3 = #{parentUserKey3,jdbcType=VARCHAR},",
          "parent_user_key4 = #{parentUserKey4,jdbcType=VARCHAR},",
          "parent_user_key5 = #{parentUserKey5,jdbcType=VARCHAR},",
          "promoter_key = #{promoterKey,jdbcType=VARCHAR},",
          "version = #{version,jdbcType=INTEGER}",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallUserHierarchy record);
}